package com.set.treeset;

import java.util.TreeSet;


class Car{
	String name;
	String type;
	Car(String name,String type){
		this.name=name;
		this.type=type;
	}
	public String toString(){
		return name+"\t"+type;
	}
}

public class Example2 {
public static void main(String[] args) {
	Car c1=new Car("Car1", "Type1");
	Car c2=new Car("Car4", "Type4");
	Car c3=new Car("Car2", "Type3");
	Car c4=new Car("Car3", "Type2");
	TreeSet ts=new TreeSet();
	ts.add(c1);
	ts.add(c2);
	ts.add(c3);
	ts.add(c4);
	System.out.println(ts);
	
}
}
